﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using System.Web;

namespace BSCMFF.Core
{
    public partial class MultiLanguagePage : Page
    {
        private const string m_DefaultCulture = "en-US";

        protected override void InitializeCulture()
        {
            String selectedLanguage;

            //if (Session["culture"] != null)
            //{
            //    selectedLanguage = Session["culture"].ToString();
            //}
            //else
            //{
            //    selectedLanguage = m_DefaultCulture;
            //}

            HttpCookie cookie = Request.Cookies["Culture"];
            if (cookie != null)
            {
                selectedLanguage = cookie.Value;
            }
            else
            {
                selectedLanguage = m_DefaultCulture;
            }

            UICulture = selectedLanguage;
            Culture = selectedLanguage;

            //Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(selectedLanguage);
            //Thread.CurrentThread.CurrentUICulture = new CultureInfo(selectedLanguage);

            base.InitializeCulture();
        }
        
    }
}
